package com.clever.mall.controller;

import com.clever.mall.commons.result.BaseResult;
import com.clever.mall.utils.StatusCode;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ChenWang
 * @className ErrorController
 * @date 2020/11/09 11:37
 * @since JDK 1.8
 */
@RestController
public class ErrorController {
    //   4xx
    //   400   401  403  404
    //   500 501 502
    @RequestMapping("/404")
    public BaseResult<Object> error404() {
        return BaseResult.error(StatusCode.ERROR);
    }

    @RequestMapping("/500")
    public BaseResult<Object> error500() {
        return BaseResult.error(StatusCode.SERVER_ERROR);
    }

}
